import { request, HttpMethod, restartTimes, RequestConfig } from './request'
// 病情概况相关操作

export const getBMI = (patientUid: string) => {
  const config = <RequestConfig>{
    url: `/patient/patientBmiMana/getByPatientBmiManaEntityObject`,
    method: HttpMethod.POST,
    data: {
      patientUid: patientUid,
    }
  }
  return request(config);
} 

export const getNewestBPL = (patientUid: string | number) => {
  // console.log('参数是', patientUid);
  const config = <RequestConfig>{
    url: `/patient/persureHeartRate/getNewlyPressureData`,
    method: HttpMethod.GET,
    data: { patientUid: patientUid }
  }
  return request(config);
}

export const getHeartRate = (patientUid: string | number) => {
  const config = <RequestConfig>{
    url: `/patient/heartRateLogs/get_newly_heart_rate_data`,
    method: HttpMethod.GET,
    data: {
      patientUid: patientUid,
    }
  }
  return request(config);
}

export const getDisease = (patientUid: string | number) => {
  const config = <RequestConfig>{
    url: `/patient/patientNowDisease/get_disease_time`,
    method: HttpMethod.GET,
    data: {
      patientUid: patientUid,
    }
  }
  return request(config);
}

export const deleteDisease = (pddId: number) => {
  const config = <RequestConfig>{
    url: `/patient/patientNowDisease`,
    method: HttpMethod.DELETE,
    data: [pddId]
  }
  return request(config);
}

export const addDisease = (data: Object) => {
  const config = <RequestConfig>{
    url: `/patient/patientNowDisease`,
    method: HttpMethod.POST,
    data: data
  }
  return request(config);
}

export const getPMH = (patientUid: string | number) => {
  const config = <RequestConfig>{
    url: `/patient/aiPreDiagnosis/report/${patientUid}`,
    method: HttpMethod.GET,
  }
  return request(config);
}

export const getPH = (patientUid: string | number) => { 
  const config = <RequestConfig>{
    url: `/patient/aiPreDiagnosis/smoking-and-drinking-info/${patientUid}`,
    method: HttpMethod.GET,
  }
  return request(config);
}

export const getFH = (patientUid: string | number) => {
  const config = <RequestConfig>{
    url: `/patient/aiPreDiagnosis/family-history/${patientUid}`,
    method: HttpMethod.GET,
  }
  return request(config);
}